-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consolidate standard lints into a cargo config file #3386
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This lint might only trigger on beta or nightly at the moment.
teor2345
added
A-rust
Area: Updates to Rust code
C-cleanup
Category: This is a cleanup
P-Low ❄️
A-diagnostics
Area: Diagnosing issues or monitoring performance
labels
Jan 24, 2022
Codecov Report
@@ Coverage Diff @@
## main #3386 +/- ##
=======================================
Coverage 78.35% 78.36%
=======================================
Files 267 267
Lines 31523 31523
=======================================
+ Hits 24701 24702 +1
+ Misses 6822 6821 -1 |
conradoplg
approved these changes
Jan 24, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seemed weird that clippy reads arguments from rustflags, but it does work
gustavovalverde
added a commit
that referenced
this pull request
Jan 24, 2022
gustavovalverde
added a commit
that referenced
this pull request
Jan 25, 2022
* Segregate linting jobs from CI workflow Lint on push to all branches, except for main, as this action will be required to merge. Just run the lint action when a Rust file is changed, as it won't make sense to run it on other scenarios. DRY with uneeded jobs * Make actions dependable on changed files or folders * Fix & add missing paths * Revert changes removing cargo.lock and deny.toml checks Also refactor this to use a more redable and change prone cargo-deny-action. And move this actions out of the clippy-deps job, as this are more related to CI than linting. * Fix wrong indentation * Add new configuration file from #3386 * Do not fail on licenses as this configuration is missing * Do not add advisories features Add advisories checks in a different PR * Allow tests and coverage on PR series If we only run CI on branches that are going to merge to main, then PR series become a lot harder to test. (Because each PR is based on the previous PR, not main.)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-diagnostics
Area: Diagnosing issues or monitoring performance
A-rust
Area: Updates to Rust code
C-cleanup
Category: This is a cleanup
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
In PR #3332, we added a Rust 2021 lint to Zebra's library crates. But we forgot to lint acceptance tests, examples, build scripts, and binaries. (These are technically separate crates.)
It would be much easier if we just had all of Zebra's standard lints in one place.
Specifications
We use cargo's hierarchical config structure to apply the lints to every crate:
https://doc.rust-lang.org/cargo/reference/config.html#hierarchical-structure
This is similar to Embark Studio's lint configuration:
EmbarkStudios/rust-ecosystem#59
https://github.com/EmbarkStudios/rust-ecosystem/blob/main/lints.toml
Solution
zebra/.cargo/config.toml
Review
@dconnolly or anyone else can review this PR.
It should be merged before #3377 by @gustavovalverde, because it changes the paths that are used for lint CI.
Reviewer Checklist
Follow Up Work
Add more lints over time.